package com.ts.audiocamera

import android.opengl.GLSurfaceView
import android.os.Bundle
import android.view.SurfaceView

import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.ts.opengl.TextureDisRender



class OpenglRenderActivity : AppCompatActivity() {
    var surface:GLSurfaceView?=null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_textture_render)

        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
            insets

        }

        surface=findViewById<GLSurfaceView>(R.id.gl_surface_view)

        surface?.setEGLContextClientVersion(2)
        surface?.renderMode=GLSurfaceView.RENDERMODE_WHEN_DIRTY
        surface?.setRenderer(TextureDisRender(this))
    }
}